package com.fs.jzzn.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.fs.jzzn.pojo.Contract;
/**
 * @author TiddlerCJ
 */
public interface ContractRepository extends JpaRepository<Contract,String>, JpaSpecificationExecutor<Contract>{
	
	/**
	 * 查找子分包合同
	 * @param contractNo
	 * @return
	 */
	@Query(value="SELECT inf.subcontract  FROM p_information inf LEFT JOIN p_project p ON inf.p_no = p.p_no  WHERE inf.subcontract is not NULL and inf.subcontract<>'' and p.contract_no=?1  ",nativeQuery=true)
	List<String> getChildContractList(String contractNo);
	
	List<Contract> findByContractNoIn(List<String> list);
}
